Split array into groups of three instead of groups of two